package ch5;

import java.util.Scanner;

public class Shoping {

	public static void main(String[] args) {
		// 10家店，最多买6件，提前走
		int total = 0;// 总共买了多少
		Scanner in = new Scanner(System.in);
		String reply = "";
		for (int i = 1; i <= 10; i++) {
			System.out.println("进入了第" + i + "家店：");
			for (int j = 1; j <= 6; j++) {
				System.out.println("第" + i + "家还买不？");
				reply = in.next();
				if (!reply.equals("买")) {
					break;
				}
				total++;
			}
			System.out.println("老婆累不？");
			reply = in.next();
			if (reply.equals("累"))
				break;
		}
		System.out.println("本次逛街买了" + total + "件");
	}

}
